package com.ymatou.iapi.productmanager.testcase;

import com.ymatou.iapi.productmanager.parameter.product.*;
import com.ymatou.iapi.productmanager.service.ModifySellerProductCall;
import com.ymatou.iapi.productmanager.service.SaveCatalogPackageListCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.tag.P1;
import com.ymttest.business.service.*;
import com.ymttest.common.order.userquery.util.HttpClientUtil;
import com.ymttest.database.annotation.SqlMapperFactory;
import com.ymttest.database.annotation.product.IntergratedProductMapper;
import com.ymttest.database.model.YmtCatalogsI;
import com.ymttest.database.model.YmtProductsI;
import com.ymttest.database.sqlwapper.YmtCatalogsIWapper;
import com.ymttest.database.sqlwapper.YmtProductsIWapper;
import com.ymttest.database.sqlwapper.Ymt_ExpressCountryToModeWapper;
import com.ymttest.database.sqlwapper.Ymt_ExpressSellerToModeWapper;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.MapUtil;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.YMTDateUtil;
import org.json.JSONObject;
import org.junit.*;
import org.junit.experimental.categories.Category;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class Ts_ModifySellerProductV2 {
    private static String sellerName = EnvSetup.getData("productpriceSellerName");

    private static int sellerId = Integer.parseInt(EnvSetup.getData("productpriceSellerId"));
    private static int sellerId1 = Integer.parseInt(EnvSetup.getData("globalSellerId"));

    private static ModifySellerProductCall modifySellerProductCall = new ModifySellerProductCall();
    private static Ymt_ExpressCountryToModeWapper countryToModeWapper=new Ymt_ExpressCountryToModeWapper();
    private static Ymt_ExpressSellerToModeWapper sellerToMode=new Ymt_ExpressSellerToModeWapper();
    private static ProductPriceCallService priceCallService = new ProductPriceCallService();
    @BeforeClass
    public static void setUp() {
        Logger.createResultFile("修改商品");
       // SqlMapperFactory.getIntergratedProductMapper().updateProductoffSale(sellerId);
    }

    @Before
    public void caseUp() {
    }

    @AfterClass
    public static void tearDown() {
        Logger.generateResult(modifySellerProductCall.getOpurl());
    }

    @After
    public void caseDown() {
        Logger.end();
    }

//24761611 zhaxiana
    /**
     * 0开头指参数校验
     * 1开头指商品领域
     * 2开头指规格领域
     * 3开头指物流领域
     * @throws Exception
     */

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1001() throws Exception {
        Logger.start(true,"商品-编辑商品名称");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            ProductSaveModel productSaveModel = modifyBean.getProduct();
            productSaveModel.setProductName("001");

            modifyProductMock(); modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("200",modifySellerProductCall.getString("Code"),"验证Code");
            AddProductCallServiceV2.checkModifyProduct(productId,modifyBean);
            
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1002() throws Exception {
        Logger.start(true,"商品-编辑商品属性");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            ProductSaveModel productSaveModel = modifyBean.getProduct();
            productSaveModel.setRemark("remark_mtest");
            //品牌
            productSaveModel.setBrandId(10145);
            productSaveModel.setBrandName("");
            //商品名称
            productSaveModel.setProductName("修改测试001");
            //修改图片信息
            String pic1 = "http:://pic1.ymatou.com/G01//M00/3A/B5/modify-Uj1GHqM097.png";
            String pic2 = "http:://pic1.ymatou.com/G01//M00/322/B5/modify-Uj1GHqM097.png";
            productSaveModel.setProductPicList(Arrays.asList(pic1,pic2));
            //noticeRisk
            productSaveModel.setNoticeRisk(true);
            //autorefresh
            productSaveModel.setAutoRefresh(true);
            //productcode
            productSaveModel.setProductCode("312312325y");
            //no reason return
            productSaveModel.setNoReasonReturn(true);
            //on sale type
            productSaveModel.setOnSaleType(0);
            //Tariff  Type
            productSaveModel.setTariffType(0);
            productSaveModel.setValidStart(new SimpleDateFormat(YMTDateUtil.YMDHMS).format(YMTDateUtil.getDate()));
            productSaveModel.setValidEnd(new SimpleDateFormat(YMTDateUtil.YMDHMS).format(YMTDateUtil.getBeforeOrNextDate(7)));
            
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("200",modifySellerProductCall.getString("Code"),"验证Code");
            AddProductCallServiceV2.checkModifyProduct(productId,modifyBean);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1003() throws Exception {
        Logger.start(true,"商品-编辑商品，商品数据缺失，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.setProduct(null);
            
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("400",modifySellerProductCall.getString("Code"),"商品数据不能为空");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1004() throws Exception {
        Logger.start(true,"商品-编辑商品，商品规格数据缺失，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setCatalogList(null);
            modifyProductMock(); modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("500",modifySellerProductCall.getString("Code"),"商品数据不能为空");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1005() throws Exception {
        Logger.start(true,"商品-编辑商品，买手数据缺失，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.setSellerId(null);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("400",modifySellerProductCall.getString("Code"),"请求参数用户编号无效");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1006() throws Exception {
        Logger.start(true,"商品-编辑商品，商品名称含有不宜发布的特殊字符，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setProductName("\\nihaoa");
            modifyProductMock(); modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"商品名称含有不宜发布的特殊字符");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    @Ignore
    public void Tc_ModifySellerProduct_1007() throws Exception {
        Logger.start(true,"商品-编辑商品，商品结束时间大于开始时间，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setValidStart("2117-11-02 17:43:36");
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"商品名称含有不宜发布的特殊字符");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1008() throws Exception {
        Logger.start(true,"商品-编辑商品，商品名称没有填，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setProductName(null);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"商品名称必填");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1009() throws Exception {
        Logger.start(true,"商品-编辑商品，无效的商品图片，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setProductPicList(new ArrayList<String>());
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"无效的商品图片");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1010() throws Exception {
        Logger.start(true,"商品-编辑商品，主图中含有重复的商品图片，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            List<String> list = new ArrayList<>();
            list.add("http://pc1.img.ymatou.com/G01/shangou/M00/2C/D0/rBBlD1gHOV6AY32AAAEN6UG5TOc701_400_401_n_w_l.jpg");
            list.add("http://pc1.img.ymatou.com/G01/shangou/M00/2C/D0/rBBlD1gHOV6AY32AAAEN6UG5TOc701_400_401_n_w_l.jpg");
            list.add("http://pc1.img.ymatou.com/G01/shangou/M00/2C/D0/rBBlD1gHOV6AY32AAAEN6UG5TOc701_400_401_n_w_l.jpg");
            modifyBean.getProduct().setProductPicList(list);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"主图中含有重复的商品图片");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1011() throws Exception {
        Logger.start(true,"商品-编辑商品，无配送方式，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setCatalogStatus(0);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"请选择配送方式");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1012() throws Exception {
        Logger.start(true,"商品-编辑商品，发布但不上架设置为自动延期，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setOnSaleType(2);
            modifyBean.getProduct().setAutoRefresh(true);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("400",modifySellerProductCall.getString("Code"),"发布但不上架不能设置为自动延期");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1013() throws Exception {
        Logger.start(true,"商品-编辑商品，设置保税商品，不填写保税区，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setCatalogStatus(4);
            modifyBean.getProduct().setBondedArea(0);
           // modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"保税商品，必须填写保税区。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1014() throws Exception {
        Logger.start(true,"商品-编辑商品，没有商品二级类目，发布成功");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setSecondCategoryId(0);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("200",modifySellerProductCall.getString("Code"),"根据三级类目补全");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1040() throws Exception {
        Logger.start(true,"商品-编辑商品，商品立即上架，开始时间和结束时间隔是7天");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setOnSaleType(0);
            modifyBean.getProduct().setValidEnd("2117-11-02 17:43:36");
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("200",modifySellerProductCall.getString("Code"),"根据三级类目补全");
            YmtProductsI ymtProductsI = new YmtProductsIWapper().selectProductByProductId(productId).get(0);
            AssertService.assertTime(YMTDateUtil.getDate(),ymtProductsI.getValidStart(),120,"验证商品的上架时间");
            AssertService.assertTime(YMTDateUtil.getBeforeOrNextDate(7),ymtProductsI.getValidEnd(),120,"验证商品的下架时间");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1041() throws Exception {
        Logger.start(true,"商品-编辑商品，商品定时上架，开始时间和结束时间隔是7天");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setOnSaleType(1);
            modifyBean.getProduct().setValidEnd("2117-11-02 17:43:36");
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("200",modifySellerProductCall.getString("Code"),"根据三级类目补全");
            YmtProductsI ymtProductsI = new YmtProductsIWapper().selectProductByProductId(productId).get(0);
            AssertService.assertTime(YMTDateUtil.getDate(),ymtProductsI.getValidStart(),120,"验证商品的上架时间");
            AssertService.assertTime(YMTDateUtil.getBeforeOrNextDate(7),ymtProductsI.getValidEnd(),120,"验证商品的下架时间");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1015() throws Exception {
        Logger.start(true,"商品-编辑商品，没有商品三级类目，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setThirdCategoryId(0);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("400",modifySellerProductCall.getString("Code"),"商品分类不能为空");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1016() throws Exception {
        Logger.start(true,"商品-编辑商品，商品文描为空，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setDescModel(null);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"商品文描不能为空");
        }catch(Exception e){
            Logger.fail(e);
        }
    }


    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1017() throws Exception {
        Logger.start(true,"商品-编辑商品，文描图中含有重复的图片，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            String str = "http://s2.ymatou.com/home/4aa0780b5ffeee46a01f132052fdb71a.png";
            modifyBean.getProduct().getDescModel().setDescPicList(Arrays.asList(str,str,str));
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"文描图中含有重复的图片");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1018() throws Exception {
        Logger.start(true,"商品-编辑商品，强制下架的商品，不能上架，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            new YmtProductsIWapper().updateCheckStatus(productId,-1);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"强制下架的商品，不能上架");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1019() throws Exception {
        Logger.start(true,"商品-编辑商品，商品备注长度超过700个英文字符，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            String remark = "123";
            for(Integer i=0;i<701;i++){
                remark = remark + i.toString();
            }
            modifyBean.getProduct().setRemark(remark);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"商品备注长度不能超过700个英文字符");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1020() throws Exception {
        Logger.start(true,"商品-编辑商品，修改视频");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            ProductSaveModel productSaveModel = modifyBean.getProduct();
            //新增视频
            ProductVideoSaveModel productVideo = new ProductVideoSaveModel();
            productVideo.setVideoUrl("http://v2.ymatou.com/uploads/20180103/6a44924f0b4968e88321061a3704b4cf.mp4");
            productVideo.setPic("http://pic1.ymatou.com/G01/shangou/modif/3B/22/rBBlD1pMiOCAWitxAADUmGEFNI0402_1_1_n_w_o.jpg");
            productVideo.setLength(11573);
            productVideo.setWidth(400);
            productVideo.setHeight(30);
            productVideo.setSize(3070568);
            productSaveModel.setVideoModel(productVideo);

            productSaveModel.setValidStart(new SimpleDateFormat(YMTDateUtil.YMDHMS).format(YMTDateUtil.getDate()));
            productSaveModel.setValidEnd(new SimpleDateFormat(YMTDateUtil.YMDHMS).format(YMTDateUtil.getBeforeOrNextDate(7)));
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("200",modifySellerProductCall.getString("Code"),"验证Code");
            AddProductCallServiceV2.checkModifyProduct(productId,modifyBean);
            //修改视频
            ProductVideoSaveModel productVideo2 = new ProductVideoSaveModel();
            productVideo2.setVideoUrl("http://v2.ymatou.com/uploads/20180122/6a44924f0b4968e88321231061a3704b4cf.mp4");
            productVideo2.setPic("http://pic1.ymatou.com/G01/shangou/add/3B/22/rBBlD1pMi123OCAWitxAADUmGEFNI0402_1_1_n_w_o.jpg");
            productVideo2.setLength(11173);
            productVideo2.setWidth(440);
            productVideo2.setHeight(410);
            productVideo2.setSize(307218);
            productSaveModel.setVideoModel(productVideo2);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("200",modifySellerProductCall.getString("Code"),"验证Code");
            AddProductCallServiceV2.checkModifyProduct(productId,modifyBean);

        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1021() throws Exception {
        Logger.start(true,"商品-编辑商品，品牌id为0，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setBrandId(0);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"该商品当前使用的是自定义品牌，现在发布编辑商品需使用系统申报审核通过的品牌信息");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1022() throws Exception {
        Logger.start(true,"商品-编辑商品，商品名称敏感词校验");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setProductName("全网唯一");
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"您输入的：“全网唯一”为不宜发布的信息");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1023() throws Exception {
        Logger.start(true,"商品-编辑商品，商品规格属性敏感词校验");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().getCatalogList().get(0).getPropertyList().get(0).setPropertyValue("全网唯一");
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"您输入的：“全网唯一”为不宜发布的信息");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1024() throws Exception {
        Logger.start(true,"商品-编辑商品，商品文描文字敏感词校验");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().getDescModel().setDescription("全网唯一");
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"您输入的：“全网唯一”为不宜发布的信息");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1025() throws Exception {
        Logger.start(true,"商品-编辑商品，商品属性属性值列表敏感词校验");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            String str = "全网唯一";
            modifyBean.getProduct().getPropertyList().get(0).getPropertyValues().add(str);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"您输入的：“全网唯一”为不宜发布的信息");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1026() throws Exception {
        Logger.start(true,"商品-编辑商品，文描文字部分为空");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().getDescModel().setDescription(null);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"商品文描不能为空");
        }catch(Exception e){
            Logger.fail(e);
        }
    }


    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1028() throws Exception {
        Logger.start(true,"商品-编辑商品，不填商品属性，发布成功，商品属性不校验");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setPropertyList(null);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("200",modifySellerProductCall.getString("Code"),"商品文描不能为空");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_1029() throws Exception {
        Logger.start(true,"商品-编辑商品，商品品牌不存在，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setBrandId(100000);
            modifyBean.getProduct().setBrandName("随意");
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"您录入的品牌暂未收录");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_2001() throws Exception {
        Logger.start(true,"规格-编辑商品，规格价格为 0，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().getCatalogList().get(0).setPrice(0);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"规格价格不能为 0");
        }catch(Exception e){
            Logger.fail(e);
        }
    }


    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_2002() throws Exception {
        Logger.start(true,"规格-编辑商品，已启用的规格库存不能小于 0，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().getCatalogList().get(0).setStock(-1);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"已启用的规格库存不能小于 0");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_2003() throws Exception {
        Logger.start(true,"规格-编辑商品，新客价或VIP价不能小于 0 或高于原价，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            //原价小于0
            modifyBean.getProduct().getCatalogList().get(0).setPrice(-1);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"新客价或VIP价不能小于 0 或高于原价。");
            //需修改的参数 vip价高与原价
            modifyBean.getProduct().getCatalogList().get(0).setPrice(10);
            modifyBean.getProduct().getCatalogList().get(0).setVipPrice(20);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"新客价或VIP价不能小于 0 或高于原价。");
            //新客价高于原价
            modifyBean.getProduct().getCatalogList().get(0).setVipPrice(8);
            modifyBean.getProduct().getCatalogList().get(0).setNewPrice(20);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"新客价或VIP价不能小于 0 或高于原价。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_2004() throws Exception {
        Logger.start(true,"规格-编辑商品，商品规格含有不宜发布的特殊字符“\\” ，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().getCatalogList().get(0).getPropertyList().get(0).setPropertyValue("\\nihaoa ");
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"商品规格含有不宜发布的特殊字符");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_2005() throws Exception {
        Logger.start(true,"规格-编辑商品，没有设置规格的套装信息 ，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().getCatalogList().get(0).setPackage(true);
            modifyBean.getProduct().getCatalogList().get(0).setSubCatalogIdList(null);
            modifyProductMock();
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"请设置规格的套装信息。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_2006() throws Exception {
        Logger.start(true,"规格-编辑商品，Fbx商品规格商品编码为空，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setCatalogType(2);
            modifyBean.getProduct().getCatalogList().get(0).setSku(null);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"Fbx商品规格商品编码不能为空。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_2007() throws Exception {
        Logger.start(true,"规格-编辑商品，Fbx商品类型不支持可预订商品，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setCatalogType(2);
            modifyBean.getProduct().getCatalogList().get(0).setSku("123456");
            modifyBean.getProduct().getCatalogList().get(0).setPreSale(true);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"Fbx商品类型不支持可预订商品。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_2008() throws Exception {
        Logger.start(true,"规格-编辑商品，商家商品编码超过50个汉字或英文字符，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            String str = "你好啊";
            for (int i=0;i<51;i++){
                str = str + i;
            }
            modifyBean.getProduct().getCatalogList().get(0).setSku(str);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"商家商品编码不得超过50个汉字或英文字符");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_2009() throws Exception {
        Logger.start(true,"规格-编辑商品，商品条码不得超过30个汉字或英文字符，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            String str = "你好啊";
            for (int i=0;i<30;i++){
                str = str + i;
            }
            modifyBean.getProduct().getCatalogList().get(0).setProductCode(str);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"商品条码不得超过30个汉字或英文字符，请修改");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

   

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_2017() throws Exception {
        Logger.start(true,"规格-编辑商品，买手注册地发不允许销售的品牌,失败");
        try{
            JSONObject retBrand = new JSONObject(HttpClientUtil.requestPost("http://sellerAllocation.iapi.ymatou.com/Api/SellerAllocation/GetSellerCategory",
                    MapUtil.hashMap("SellerId",String.valueOf(3383))));
            if (retBrand.getJSONObject("Data").getString("BadBrandIDs")!="null"){
                AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(3383);
                String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
                ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
                modifyBean.getProduct().setProductName("自动化测试_"+ YMTDateUtil.getSysTime("yyyy-MM-dd-HH-mm-ss-SSS"));
                modifyBean.getProduct().setRemark("remark_test");
                modifyBean.getProduct().setBrandId(retBrand.getJSONObject("Data").getJSONArray("BadBrandIDs").getInt(0));
                modifyProductMock(); 
                modifySellerProductCall.setData(modifyBean);
                modifySellerProductCall.callService();
                Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"很抱歉，您的注册地暂不支持销售该品牌。您可选择注册地的本土品牌进行售卖");
            }
        }catch(Exception e){
            Logger.fail(e);
        }
    }

   

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_2012() throws Exception {
        Logger.start(true,"规格-编辑商品，添加多规格商品带套装商品，发布成功");
        try{
            SaveCatalogPackageListCall saveCatalogPackageListCall = new SaveCatalogPackageListCall();
            int packageId1 = saveCatalogPackageListCall.callAndGetReturnData(MapUtil.hashMap("ProductPackageList[0]->SubCatalogName","测试组合001测试组合001"))
                    .getJSONObject("Data").getJSONArray("SubCatalogIdList").getInt(0);

            int packageId2 = saveCatalogPackageListCall.callAndGetReturnData(MapUtil.hashMap("ProductPackageList[0]->SubCatalogName","测试组合002测试组合001"))
                    .getJSONObject("Data").getJSONArray("SubCatalogIdList").getInt(0);
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            //需要修改的参数
            addProdReq.getProduct().getCatalogList().get(0).setPackage(true);
            addProdReq.getProduct().getCatalogList().get(0).setSubCatalogIdList(Arrays.asList(packageId1,packageId2));
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("200",modifySellerProductCall.getString("Code"),"验证Code");
            AddProductCallServiceV2.checkModifyProduct(productId,modifyBean);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_2013() throws Exception {
        Logger.start(true,"规格-编辑商品，发布预定自动延期商品，发布成功");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().getCatalogList().get(0).setPreSale(true);
            modifyBean.getProduct().getCatalogList().get(1).setPreSale(true);
            modifyBean.getProduct().setAutoRefresh(true);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("200",modifySellerProductCall.getString("Code"),"验证Code");
            AddProductCallServiceV2.checkModifyProduct(productId,modifyBean);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_2014() throws Exception {
        Logger.start(true,"规格-编辑商品，发布商品，商品条码为空，发布成功");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().getCatalogList().get(0).setProductCode(null);
            modifyBean.getProduct().getCatalogList().get(1).setProductCode(null);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("200",modifySellerProductCall.getString("Code"),"验证Code");
            AddProductCallServiceV2.checkModifyProduct(productId,modifyBean);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

   

    @Test
    @Category({P1.class})
    @TestCase
    @Ignore
    public void Tc_ModifySellerProduct_2016() throws Exception {
        Logger.start(true,"规格-编辑商品，成为FBX商品，发布成功");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(3383);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            addProdReq.getProduct().setCatalogType(2);
            //需要去贝海那边找有效的sku
            addProdReq.getProduct().getCatalogList().get(0).setSku("ceshi100");
            addProdReq.getProduct().getCatalogList().get(1).setSku("ceshi100");
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("200",modifySellerProductCall.getString("Code"),"发布失败，您填写的商品编码无效");
            AddProductCallServiceV2.checkModifyProduct(productId,modifyBean);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_3001() throws Exception {
        Logger.start(true,"活动商品-活动商品，且报名了活动，商品规格变动后需驳回商品活动报名");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);

            //获取规格ID
            List<String> catalogs = new YmtCatalogsIWapper().selectCatalogsByProductId(productId).stream().map(YmtCatalogsI::getsCatalogId).collect(Collectors.toList());
            //创建一个活动  得到活动id
            Integer activityId = ProductManagerCallServiceV2.createIsolationActivityInProcess();
            //报名活动  获得商品在活动中的id
            List<String> aids = ProductManagerCallServiceV2.ApplyActivity(productId, sellerId,catalogs,activityId, 100,"10");
            //审核通过
            ProductManagerCallServiceV2.approveProductInActivity(productId,aids.get(0),true);

            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            addProdReq.getProduct().getCatalogList().get(0).setPrice(100);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"此报名活动商品已审核通过，活动结束后可正常编辑。您可以在商品管理列表中对库存进行修改！");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_3003() throws Exception {
        Logger.start(true,"编辑商品库商品，尺码模板没填，编辑失败(等研发修复）");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(3383);
            addProdReq.getProduct().setSpuId(238429);
            addProdReq.getProduct().setBrandId(10123);
            addProdReq.getProduct().setThirdCategoryId(1138);
            addProdReq.getProduct().getDescModel().setSizeTemplateId(199);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().getDescModel().setSizeTemplateId(0);
            modifyProductMock();
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"您已选择了商品库商品，尺码表模板必填。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    @Ignore
    //需要设置物流对应价格 接口的串联，否则需要mock
    public void Tc_ModifySellerProduct_4001() throws Exception {
        Logger.start(true,"物流-编辑商品，商品的物流方式不支持该价格，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV2.initAddSellerProductRequest(288484);
            String ProductId = ProductManagerCallServiceV2.addNewProduct(addProdReq).get("Data").getAsJsonObject().get("ProductId").getAsString();
            ModifySellerProductRequest modifyBean = ProductManagerCallServiceV2.getModifySellerProductRequestFromAddProductBean(ProductId,addProdReq);
            ProductSaveModel productSaveModel = modifyBean.getProduct();
            productSaveModel.setRemark("remark_mtest");
            //品牌
            productSaveModel.setBrandId(10145);
            productSaveModel.setBrandName("");
            //商品名称
            productSaveModel.setProductName("修改测试001");
            //修改品类
            productSaveModel.setThirdCategoryId(1460);
            productSaveModel.setCatalogStatus(7);
            productSaveModel.setSecondCategoryId(1420);
            //修改图片信息
            String pic1 = "http:://pic1.ymatou.com/G01//M00/3A/B5/modify-Uj1GHqM097.png";
            String pic2 = "http:://pic1.ymatou.com/G01//M00/322/B5/modify-Uj1GHqM097.png";
            productSaveModel.setProductPicList(Arrays.asList(pic1,pic2));
            //noticeRisk
            productSaveModel.setNoticeRisk(true);
            //autorefresh
            productSaveModel.setAutoRefresh(true);
            //productcode
            productSaveModel.setProductCode("312312325y");
            //no reason return
            productSaveModel.setNoReasonReturn(true);
            productSaveModel.setOnSaleType(1);
            productSaveModel.setValidStart(new SimpleDateFormat(YMTDateUtil.YMDHMS).format(YMTDateUtil.getDate()));
            productSaveModel.setValidEnd(new SimpleDateFormat(YMTDateUtil.YMDHMS).format(YMTDateUtil.getBeforeOrNextDate(7)));

            List<CatalogSaveModel> catalogList = modifyBean.getProduct().getCatalogList();
            CatalogSaveModel catalogMode1 = catalogList.get(0);
            CatalogSaveModel catalogMode2 = catalogList.get(1);

            //规格1,2 删除
            catalogMode1.setOperateType(3);
            catalogMode2.setOperateType(3);

            //新增单规格3
            AddSellerProductRequest addProdReq2 = AddProductCallService.getAddSellerProductRequestFromFile("单规格",
                    MapUtil.hashMap("sellerId",288484,"sellerName",sellerName));
            CatalogSaveModel catalogMode3 = addProdReq2.getProduct().getCatalogList().get(0);
            catalogMode3.setPrice(12000);
            catalogMode3.setVipPrice(10000);
            catalogMode3.setNewPrice(900);
            catalogMode3.setOperateType(1);
            catalogList.add(catalogMode3);
            modifyProductMock();
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"发布失败，商品的物流方式不支持该价格");
        }catch(Exception e){
            Logger.fail(e);
        }
    }


    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_4003() throws Exception {
        Logger.start(true,"物流-编辑商品，买手选择多物流，多物流差价值未填，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().getCatalogList().get(0).setMultiLogistics(3);
            modifyBean.getProduct().setMultiLogistics(2);
            modifyBean.getProduct().setFlightBalance(0);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"发布失败，请填写多物流的差价");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

  

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_4005() throws Exception {
        Logger.start(true,"物流-编辑商品，保税商品，没有买手保税区使用权限，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(288484);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setCatalogStatus(111);
            modifyBean.getProduct().setBondedArea(2);
           // modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"发布失败，没有保税区权限");
        }catch(Exception e){
            Logger.fail(e);
        }
    }


    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_4007() throws Exception {
        Logger.start(true,"物流-编辑商品，第三方保税，买手没有当前保税仓权限，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(288484);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setCatalogStatus(1111);
            modifyBean.getProduct().setBondedArea(2);
           // modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"发布失败，买手没有当前的保税仓发布权限");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_4008() throws Exception {
        Logger.start(true,"物流-编辑商品，买手没有当前物流发布权限，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(288484);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setCatalogStatus(9);//5贝海保税区，4买手保税区
            modifyBean.getProduct().setBondedArea(2);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"发布失败，买手没有当前的物流方式发布权限");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_4009() throws Exception {
        Logger.start(true,"物流-编辑商品，手没有当前的物流方式发布权限-买手国家没有物流权限，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(288484);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setCatalogStatus(5111111);//5贝海保税区，4买手保税区
            modifyBean.getProduct().setBondedArea(2);
            Ymt_ExpressCountryToModeWapper countryToModeWapper=new Ymt_ExpressCountryToModeWapper();
            Ymt_ExpressSellerToModeWapper sellerToMode=new Ymt_ExpressSellerToModeWapper();
            //先删isDelete=true
            countryToModeWapper.updateBycountryAndStatus(0, modifyBean.getProduct().getCatalogStatus(), true);
            sellerToMode.updateBySellerIdAndStatus(sellerId, modifyBean.getProduct().getCatalogStatus(), true);
           // modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"发布失败，买手没有当前的物流方式发布权限");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_4010() throws Exception {
        Logger.start(true,"物流-编辑商品，买手没有当前国家的保税仓发布权限-贝海保税区，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(288484);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setCatalogStatus(5);//5贝海保税区，4买手保税区
            modifyBean.getProduct().setBondedArea(2);
            Ymt_ExpressCountryToModeWapper countryToModeWapper=new Ymt_ExpressCountryToModeWapper();
            Ymt_ExpressSellerToModeWapper sellerToMode=new Ymt_ExpressSellerToModeWapper();
            //先删isDelete=true
            countryToModeWapper.updateBycountryAndStatus(0, modifyBean.getProduct().getCatalogStatus(), true);
            sellerToMode.updateBySellerIdAndStatus(sellerId, modifyBean.getProduct().getCatalogStatus(), true);
          //  modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"发布失败，买手没有当前的物流方式发布权限");
            //后设置isDelete=false
            countryToModeWapper.updateBycountryAndStatus(0, modifyBean.getProduct().getCatalogStatus(), false);
            sellerToMode.updateBySellerIdAndStatus(sellerId, modifyBean.getProduct().getCatalogStatus(), false);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

   

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_4013() throws Exception {
        Logger.start(true,"物流-编辑商品，市场价格小于含税价格,发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId1);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().getCatalogList().get(0).setMarketPrice(1);
            modifyProductMock();
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"发布失败，市场价需大于等于含税价");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_4014() throws Exception {
        Logger.start(true,"物流-编辑商品，市场价格小于0,发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId1);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().getCatalogList().get(0).setMarketPrice(-5);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"发布失败，市场价不能小于 0。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_4015() throws Exception {
        Logger.start(true,"物流-编辑商品，拼邮发货,海外发货，发布成功");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setPackageDeliveryType(1);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("200", modifySellerProductCall.getString("Code"), "发布失败，市场价不能小于 0。");
            AddProductCallServiceV2.checkModifyProduct(productId,modifyBean);
        }catch(Exception e){
            Logger.fail(e);
        }
    }



    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_4016() throws Exception {
        Logger.start(true,"物流-编辑商品，拼邮发货,国内发货，发布成功");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setPackageDeliveryType(2);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("200", modifySellerProductCall.getString("Code"), "发布失败，市场价不能小于 0。");
            AddProductCallServiceV2.checkModifyProduct(productId,modifyBean);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_4017() throws Exception {
        Logger.start(true,"物流-编辑商品，无效的拼邮类型，编辑失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setPackageDeliveryType(3);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201", modifySellerProductCall.getString("Code"), "发布失败，市场价不能小于 0。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }
    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_4018() throws Exception {
        Logger.start(true,"编辑商品更新商品标签tags,");
        try{
        	IntergratedProductMapper intergratedProductMapper = SqlMapperFactory.getIntergratedProductMapper();
        	Integer cid=1001;
			Integer thirdcategoryid=1003;
			String tag="测试"+TestDataManager.getRandomIntNum(4);
			ProductManagerCallServiceV3.DeleteAllSellerPorductTags(sellerId, thirdcategoryid);
			//添加标签
			int id=ProductManagerCallServiceV3.AddSellerPorductTags(sellerId, cid, thirdcategoryid, tag);
			
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            List<Map> list = intergratedProductMapper.selectYmtSellerProductTag(sellerId, thirdcategoryid);
			Map m = list.stream().filter(x->{return x.get("Tag").toString().equals(tag);}).findAny().get();
			Logger.debug(m);
			// UpdateTime=2020-09-16 15:59:21.027, SellerId=288484, Id=413, Tag=测试5610, LastUseTime=2020-09-16 15:59:21.027
			Thread.sleep(1100);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            List<String> tags=new ArrayList<String>();
            tags.add(tag);
            modifyBean.getProduct().setProductTags(tags);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("200", modifySellerProductCall.getString("Code"), "编辑商品");
            list = intergratedProductMapper.selectYmtSellerProductTag(sellerId, thirdcategoryid);
			Map m2 = list.stream().filter(x->{return x.get("Tag").toString().equals(tag);}).findAny().get();
			Logger.debug(m2);
			Logger.verifyNotEquals(m.get("UpdateTime").toString(), m2.get("UpdateTime").toString(), "更新UpdateTime");
			Logger.verifyNotEquals(m.get("LastUseTime").toString(), m2.get("LastUseTime").toString(), "更新LastUseTime");
        }catch(Exception e){
            Logger.fail(e);
        }
    }
    ////////////////////////////  此case 被忽略，可以是业务下架////////////////
    @Test
    @Category({P1.class})
    @TestCase
    @Ignore
    public void Tc_ModifySellerProduct_1030() throws Exception {
        Logger.start(true,"商品-编辑商品，发布优选商品类目跟商品库不匹配，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setSpuId(825443564);
            modifyBean.getProduct().setSecondCategoryId(378263);
            modifyBean.getProduct().setThirdCategoryId(93274);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"您已选择了商品库商品，商品品类和品牌需与优选商品模板保持一致不能修改。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    @Ignore
    public void Tc_ModifySellerProduct_1031() throws Exception {
        Logger.start(true,"商品-编辑优选商品，买手支持拼邮溯源，并且选择物流拼邮，成功");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(3383);
            addProdReq.getProduct().setSpuId(238429);
            addProdReq.getProduct().setBrandId(10123);
            addProdReq.getProduct().setThirdCategoryId(1138);
            addProdReq.getProduct().getDescModel().setSizeTemplateId(199);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            new YmtProductsIWapper().updatePspStatus(productId,4);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setCatalogStatus(7);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("200",modifySellerProductCall.getString("Code"),"您已选择了商品库商品，尺码表模板必填。");
            AddProductCallServiceV2.checkModifyProduct(productId,modifyBean);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    @Ignore
    public void Tc_ModifySellerProduct_2010() throws Exception {
        Logger.start(true,"规格-编辑商品，Fbx商品套装规格的商品编码为空，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setCatalogType(2);
            modifyBean.getProduct().getCatalogList().get(0).setPackage(true);
            modifyBean.getProduct().getCatalogList().get(0).setSubCatalogIdList(Arrays.asList(3911));
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"Fbx商品套装规格的商品编码不能为空，请修改");
        }catch(Exception e){
            Logger.fail(e);
        }
    }
    
    @Test
    @Category({P1.class})
    @TestCase
    @Ignore
    public void Tc_ModifySellerProduct_2011() throws Exception {
        Logger.start(true,"规格-编辑商品，FBX多规格商品编码不是贝海有效期编码，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setCatalogType(2);
            modifyBean.getProduct().getCatalogList().get(0).setSku("029149");
            modifyBean.getProduct().getCatalogList().get(1).setSku("383627");
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"发布失败，您填写的商品编码无效，请先确认FBX仓库是否选择正确");
        }catch(Exception e){
            Logger.fail(e);
        }
    }
    
    @Test
    @Category({P1.class})
    @TestCase
    @Ignore
    public void Tc_ModifySellerProduct_2015() throws Exception {
        Logger.start(true,"规格-编辑商品，发布FBX商品，商品条码为空，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            addProdReq.getProduct().setCatalogType(2);
            addProdReq.getProduct().getCatalogList().get(0).setProductCode(null);
            addProdReq.getProduct().getCatalogList().get(1).setProductCode(null);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"发布失败，您填写的商品编码无效");
        }catch(Exception e){
            Logger.fail(e);
        }
    }
    
    
    
    @Test
    @Category({P1.class})
    @TestCase
    @Ignore
    public void Tc_ModifySellerProduct_3002() throws Exception {
        Logger.start(true,"优选审核中的商品对应的商品库商品不能修改");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(3383);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            new YmtProductsIWapper().updatePspStatus(productId,3);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setSpuId(825497641);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"优选审核中和审核通过的商品对应的商品库商品不能修改");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    @Ignore
    public void Tc_ModifySellerProduct_3000() throws Exception {
        Logger.start(true,"优选审核通过的商品对应的商品库商品不能修改");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(3383);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            new YmtProductsIWapper().updatePspStatus(productId,4);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setSpuId(825497641);
            modifyProductMock(); modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"优选审核中和审核通过的商品对应的商品库商品不能修改");
        }catch(Exception e){
            Logger.fail(e);
        }
    }
    
    
    
    @Test
    @Category({P1.class})
    @TestCase
    @Ignore //大贸买手跟买手权限配置有关
    public void Tc_ModifySellerProduct_4011() throws Exception {
        Logger.start(true,"物流-编辑商品，大贸买手发预定商品,发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(24636606);
            addProdReq.getProduct().setCatalogStatus(1);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().getCatalogList().get(0).setPreSale(true);
          //  modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("400",modifySellerProductCall.getString("Code"),"发布失败，您当前所在国家不支持发布预订商品");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    @Ignore
    public void Tc_ModifySellerProduct_4012() throws Exception {
        Logger.start(true,"物流-编辑商品，大贸买手发FBX商品,发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(24636606);
            addProdReq.getProduct().setCatalogStatus(1);
            String productId = ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            ModifySellerProductRequest modifyBean = AddProductCallServiceV2.getModifySellerProductRequestFromAddProductBean(productId,addProdReq);
            modifyBean.getProduct().setCatalogType(2);
            modifyProductMock(); 
            modifySellerProductCall.setData(modifyBean);
            modifySellerProductCall.callService();
            Logger.verifyEquals("201",modifySellerProductCall.getString("Code"),"发布失败，买手没有当前的物流方式发布权限");
        }catch(Exception e){
            Logger.fail(e);
        }
    }
    
    
    /**
     * 单纯mock修改商品
     * add by summing 20201223
     * @return
     */
    private  void modifyProductMock()
    {
    	modifySellerProductCall.addHeader("mock", "mock-enable");
	     //物流权限1
    	modifySellerProductCall.addHeader("mockId-1", "GUID");
        modifySellerProductCall.addHeader("mockApi-1", "orderdelivery-GetAvailableDeliveryMethod-Normal");
        //物流权限2
        modifySellerProductCall.addHeader("mockId-2", "GUID");
        modifySellerProductCall.addHeader("mockApi-2", "orderdelivery-GetAvailableDeliveryMethodV2-Normal");
        //自动巡检
        modifySellerProductCall.addHeader("mockId-3", "GUID");
        modifySellerProductCall.addHeader("mockApi-3", "Violate-autoPreViolateProduct-Normal");
        //买手专项权限
        modifySellerProductCall.addHeader("mockId-4", "GUID");
        modifySellerProductCall.addHeader("mockApi-4", "sellerallocation-checkSellerSpecialPermission-Normal");
        //发商品的数量
		modifySellerProductCall.addHeader("mockId-5", "GUID");
		modifySellerProductCall.addHeader("mockApi-5", "SellerService-getSellerSeat-Normal");
    }
    
}
